1. Field of the Invention
This invention pertains generally to invoking run-time routines in computer programming languages, and more particularly to a method for linking related run-time routines to functional modules or "chains".
2. Description of the Background Art
In existing programming languages, including the "C" programming language, there is no provision for linking routines that are independently compiled but need to be called at the same point. For example, a computer (or embedded controller) may reset due to a power failure, a deliberate reset, or a system crash. At the startup code of the controller program, each component of the controller hardware (for example, the LCD, keypad, digital I/O and analog I/O) may need to execute different routines to restore external devices from a power failure, to reinitialize system parameters for a deliberate reset, or to record the crash time and date for a system crash.
In order to perform the above reset operation in a conventional high level programming language, the programmer must be aware of all the components being used, and call the correct reset handling routine for each possible cause of reset. This is a problem for three major reasons. First, a component may be implicitly used by another component. As a result, the programmer may not be aware of the usage of the implicit component and, therefore, not call the reset handling routines of the implicit component. Second, the programmer needs to explicitly relate the cause of reset to the handler routines, leaving much room for mistake. Third, because the decision to call reset handling routines depends on the components used, it is impossible to define a system routine to perform the conditional calls.
Therefore, there is a need for a programming language construct and method of use that reverses the responsibilities of the application programmer to the library programmers and provides for chaining related run-time routines so that the programmer need only call a function in order to execute a related routines. The "function code chaining" language construct and method of use in accordance with the present invention satisfies that need, as well as others, and overcomes the deficiencies in previously known techniques.